import sys


class CLIMain(object):
    help = Flag(["h", "help"])
    version = Flag(["v", "version"])
    
    def show_help(self):
        pass
    
    def show_version(self):
        pass


class MyApp(CLIMain):
    quiet = Flag(["q", "quiet"])
    logfile = StrParam(["logfile"])
    mode = StrEnum(["m", "mode"], values = ["tcp", "udp"])
    port = IntParam(["p", "port"], pred = lambda v: 0 <= v <= 65535)
    
    def main(self):
        pass


